JBoss Community Archive (Read Only)

Scribble

Command Line Actions

The first step is to define the command implementation
of the org.scribble.command.Command
interface. This can be created in the
org.scribble.command Eclipse plugin.

To initialise the command, as part of an OSGi
runtime environment, the command implementation can be
instantiated in the org.scribble.command
plugin's Activator, and then
registered with the bundle context.

If the command requires other OSGi services, then
these can be established by setting up service listeners
for the relevant service interface classes. When
OSGi services are registered, then the relationship
can be established.

This command mechanism will generally only be used
as part of the command line approach, and therefore
does not need to be initialised in other ways. However
other dependency injection techniques could be
used if appropriate.

The only remaining step is to create the scripts
necessary to enable a user to invoke the command.
This can be achieved by copying one of the existing
scripts, in the distribution/src/main/release
folder (such as parse.sh),
and modify the parameter details as necessary.

The first parameter of the Java application, invoked
within the script, must be the name of the command.
This must match the value returned by the
getName() method on the command
interface.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 09:37:58 UTC, last content change 2011-05-24 08:36:14 UTC.